import { EntityModel } from '@midwayjs/orm';
import { BaseEntity } from '@cool-midway/core';
import { Column } from 'typeorm';

/**
 * 描述
 */
@EntityModel('user_notify')
export class UserNotifyEntity extends BaseEntity {
  @Column({ comment: '作者', name: 'user_id' })
  userId: number;

  @Column({
    comment: '消息内容   公告和私信类型的消息使用',
    type: 'varchar',
    nullable: true,
  })
  content: string;

  @Column({
    comment: '通知类型   1、公告 2、提醒 3、私信',
    type: 'tinyint',
    name: 'type',
    nullable: true,
  })
  type: number;

  @Column({
    comment: '目标id（如post的id）',
    name: 'target_id',
    nullable: true,
  })
  targetId: number;

  
  @Column({
    comment: '1、点赞  2、评论 3、回复  4、关注 5.收藏',
    name: 'action',
    nullable: true,
  })
  action: number;
  
  @Column({
    comment: '发送者id',
    type:'int',
    name: 'sender_id',
    nullable: true,
  })
  senderId: number;
  
  @Column({
    comment: '发送者类型 1普通用户 2管理员',
    type:'int',
    default:1,
    name: 'sender_type',
    nullable: true,
  })
  senderType: number;

    
  @Column({
    comment: '消息是否已读   0未读  1已读',
    type:'int',
    name: 'is_read',
    nullable: true,
    default:0
  })
  isRead: number;
    
  @Column({
    comment: '评论id  评论的时候存储',
    type:'int',
    name: 'comment_id',
    nullable: true,
  })
  commentId: number;
}
